/*
 *  Process.h
 *  vorpal
 *
 *  Created by Russell Y Webb on 4/05/09.
 *  Copyright 2009 UC. All rights reserved.
 *
 */

#ifndef VORPAL_MODULE_H
#define VORPAL_MODULE_H

#include "Objects.h"
#include "VM.h"

namespace Vorpal{
	
	class Module : public Object{
	public:
		Module(const char *pathToScript) : Object(), sys(new Object()){ 
			VM subVM(sys);
			subVM.Execute(pathToScript, sys, sys);
		}
		
		virtual bool Receive(Message msg, uint32_t numArgs, VM *vm);
		
		virtual void Print() const{
			printf("Process\n");
		}
		
	protected:
		virtual ~Module(){ }
		virtual void MakeClone(Object *clone){ Failure(ERR_OBJ_CANNOT_CLONE); }
		
	private:
		Handle<Object> sys;
	};
}

#endif
